{extend name="common/main"/}

{block name="body"}
    <div class="main-title">
        <h2>{:lang("_MODULE_MANAGEMENT_")}</h2>
    </div>

    <div class="with-padding">

        <div class="button-box tool-box clearfix">
            <ul class="pull-left nav nav-pills nav-warning">
                <li id="type_all"><a href="{:url('Index',array('type'=>'all'))}">{:lang("_ALL_")}</a></li>
                <li id="type_installed"><a href="{:url('Index',array('type'=>'installed'))}">{:lang("_INSTALLED_")}</a></li>
                <li id="type_uninstalled"><a href="{:url('Index',array('type'=>'uninstalled'))}">{:lang("_NOT_INSTALLED_")}</a></li>
                <li id="type_core"><a href="{:url('Index',array('type'=>'core'))}">{:lang("_SYSTEM_MODULE_")}</a></li>
                <script>
                    $('#type_{$type}').addClass('active');
                </script>
            </ul>
            <div class="pull-right">
                
             <a href="{:url('Module/Index',array_merge($_GET,array('refresh'=>1)))}" class="btn btn-default"><i class="icon-undo"></i>
               {:lang("_RESET_ALL_MODULE_INFORMATION_IS_NOT_SYNCHRONIZED_TO_USE_")}</a>&nbsp;

            </div>
        </div>
        <section class="module-list cards clearfix">
            {volist name="modules" id="vo"}
                <div class="col-lg-3 col-md-4">
                    <div class="module-list-box" data-id="{$vo.id}" data-custom-admin="{$vo.custom_admin}" data-url="{$vo.admin_entry}" data-module="{$vo.name}">
                        <div class="card">
                            <div class="media-wrapper">
                                <div class="cover-icon">
                                    {if $vo.custom_admin == 0}
                                    <a href="{:url($vo.admin_entry)}">
                                        <img class="" src="{$vo.icon_image}"/>
                                    </a>
                                    {else /}
                                    <a href="{:url($vo.admin_entry)}" target="_blank">
                                        <img class="" src="{$vo.icon_image}"/>
                                    </a>
                                    {/if}
                                </div>
                            </div>
                            <div class="content">
                                <div class="card-heading title">
                                    <h3>{$vo.alias} <small>{$vo.version}</small></h1></h3>
                                </div>
                                <div class="card-content text-muted">
                                    <p class="text-muted text-ellipsis" title="{$vo.summary}">{$vo.summary}</p>
                                    <p class="">应用目录：{$vo.name}</p>
                                    <p class="text-muted text-ellipsis">
                                        {:lang("_DEVELOPER_")}{:lang('_COLON_')} <a style="color: #666">{$vo.developer}</a></p>
                                </div>
                                
                                <div class="card-actions clearfix">
                                    {if condition="($vo['is_com'] == 1) OR ($vo['can_uninstall'] == 1)"}
                                        {if condition="$vo['is_setup'] == 1"}
                                            <!--进入模块-->
                                            <a class="btn btn-block btn-info"
                                               href="{:url($vo.admin_entry)}" {if $vo.custom_admin == 1}target="_blank"{/if}>进入模块</a>
                                            <a class="btn btn-block btn-danger"
                                               href="{:url('uninstall', array('id' => $vo['id']))}">{:lang("_UNINSTALL_")}</a>
                                        {else/}
                                            <!--进入模块-->
                                            <a class="btn btn-block btn-default disabled"
                                               href="{:url($vo.admin_entry)}" {if $vo.custom_admin == 1}target="_blank"{/if}>进入模块</a>
                                            <a class="btn btn-block btn-success"
                                               href="{:url('install', array('name' => $vo['name']))}">{:lang("_INSTALL_")}</a>
                                        {/if}
                                    {else /}
                                        <a class="btn btn-block btn-info"
                                               href="{:url($vo.admin_entry)}" {if $vo.custom_admin == 1}target="_blank"{/if}>进入模块</a>
                                        <a disabled class="btn btn-block btn-default">系统模块</a>
                                    {/if}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            {/volist}
        </section>
        
        <!--模块分页-->
        <div class="pager">
            {$page}
        </div>
    </div>

{/block}
{block name="script"}

{/block}
